package cn.peach.quartz.service.impl;

import cn.peach.quartz.service.IQuartzService;
import cn.peach.quartz.util.QuartzUtil;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
@Service
public class QuartzServiceImpl implements IQuartzService {
    @Autowired
    private Scheduler scheduler;

    @Override
    public void addOrderExpireJob(String jobName, Class cls, Object params, Date excuteTime) {
        /**
         * scheduler:容器
         * jobName：名字
         * cls：工作类
         * params：参数
         * excuteTime：执行的时间
         */
        QuartzUtil.addJob(scheduler, jobName, cls, params, excuteTime);
    }
}
